#!/usr/ chuna
# -*- coding:utf-8 -*-
from sklearn.metrics import accuracy_score,precision_score,recall_score,f1_score,classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import mean_absolute_error,mean_squared_error,classification_report

# 加载数据
y_true=[1,1,1,1,1,0,0,0,0,0]
y_pred=[0,0,1,1,0,0,0,0,0,0]

# accuracy_score,pass
#accuracy_score(y_true, y_pred, normalize=True/False)

# precision_score,pass
print(precision_score(y_true,y_pred))

# recall_score,pass
print(recall_score(y_true,y_pred))

# f1_score,pass
f1_score(y_true,y_pred)

# classification_report
print("Classification Report:\n",classification_report(y_true,y_pred,target_names=["class_0","class_1"]))

# confusion_matrix,pass
confusion_matrix(y_true,y_pred,labels=[0,1])

#mean_absolute_error,pass
mean_absolute_error(y_true,y_pred)

#mean_squared_error,pass
mean_squared_error(y_true,y_pred)